package cn.tedu.six2202.day04;

import java.util.Arrays;

public class BubbleSort {
    public static void main(String[] args) {
        int[] ary = {23,12,7,0,67,9,11};

        for (int i=0;i<ary.length-1;i++){  //i表示轮数
            for (int j=0;j<ary.length-1-i;j++) {  //j表示遍历元素的下标
                if (ary[j]>ary[j+1]){
                    int tmp = ary[j];
                    ary[j]=ary[j+1];
                    ary[j+1] = tmp;
                }
            }
        }
        System.out.println(Arrays.toString(ary));
    }
}
